home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_rafthousewpnts.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  121 lines

  1. # Jones 3D Cog Script
  2. #
  3. # Riv_RaftHouseWpnts.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #========================================================================================
  9.  
  10. symbols
  11.    
  12.     message     startup
  13.     message     entered
  14.     message     killed
  15.     
  16.     # ** commies **
  17.     thing       com1
  18.     
  19.     # ** com3 waypoints **
  20.     thing       t_Wpnt0
  21.     thing       t_Wpnt1
  22.     thing       t_Wpnt2
  23.     
  24.     sector      sec_Activate1       linkID=1
  25.     sector      sec_Deactivate1     linkID=0
  26.     sector      sec_Deactivate2     linkID=0
  27.     
  28.     int         n_pos=0         local
  29.     int         n_Wpnts=3       local
  30.     int         wpntsActive=1   local
  31.     
  32.     # ** subroutines **
  33.     flex        activate_Wpnts      local
  34.     flex        deactivate_Wpnts    local
  35.     
  36. end
  37.  
  38. #========================================================================================
  39.  
  40. code
  41.  
  42. startup:
  43.  
  44.     # prepare commie
  45.     AISetCutsceneMode(com1);
  46.     
  47.     return;
  48.  
  49. #========================================================================================
  50.  
  51. entered:
  52.  
  53.     if(GetSenderID() == 1)
  54.     {
  55.         call activate_Wpnts;
  56.     }
  57.     
  58.     if(GetSenderID() == 0)
  59.     {
  60.         call deactivate_Wpnts;
  61.     }
  62.     
  63.     return;
  64.     
  65. #========================================================================================
  66.  
  67. killed:
  68.  
  69.     if(GetSenderRef() == com1) com1 = -1;
  70.     
  71.     return;
  72.  
  73. #========================================================================================
  74.  
  75. activate_Wpnts:
  76.  
  77.     if(wpntsActive == 1) return;
  78.     
  79. #    DebugPrint("RaftHouseWpnts Activated!");
  80.     
  81.     wpntsActive = 1;
  82.  
  83.     if(com1 > -1)
  84.     {
  85.         # restore commie 'brain'
  86.         AIClearCutsceneMode(com1);
  87.         
  88.         Sleep(0.01);
  89.         
  90.         for(n_pos = 0; n_pos < n_Wpnts; n_pos = n_pos + 1)
  91.         {
  92.             AISetWpnt(t_Wpnt0[n_pos], n_pos);
  93.         }
  94.     
  95.         # com1 waypoints
  96.         AIConnectWpnts(0, 1);
  97.         AIConnectWpnts(1, 2);
  98.         
  99.         AITraverseWpnts(com1, 0, 2.0, 20.0, 0);
  100.     }
  101.     
  102.     return;
  103.  
  104. #========================================================================================
  105.  
  106. deactivate_Wpnts:
  107.  
  108.     if(wpntsActive == 0) return;
  109.     
  110. #    DebugPrint("RaftHouseWpnts Deactivated!");
  111.     
  112.     wpntsActive = 0;
  113.  
  114.     if(com1 > -1) AIClearInstinctWpntMode(com1);
  115.  
  116.     return;
  117.  
  118. #========================================================================================
  119.  
  120. end
  121.